package com.dhcc.bpm.modules.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dhcc.bpm.modules.system.entity.Role;
import com.dhcc.bpm.modules.system.vo.RoleVO;

import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Map;

/**
 * @ClassName IRoleService
 * @Description 服务类
 * @Author sjm
 * @Date 2020/2/21 0021 15:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 **/
public interface IRoleService extends IService<Role> {

	/**
	 * @Description 自定义分页
	 * @Author sjm
	 * @Date 10:21 2020/2/22 0022
	 * @param page
	 * @param role
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.system.vo.RoleVO>
	 **/
	IPage<RoleVO> selectRolePage(IPage<RoleVO> page, RoleVO role);

	/**
	 * @Description 树形结构
	 * @Author sjm
	 * @Date 10:21 2020/2/22 0022
	 * @param tenantId
	 * @return java.util.List<com.dhcc.bpm.modules.system.vo.RoleVO>
	 **/
	List<RoleVO> tree(String tenantId);


	/**
	 * @Description 权限配置
	 * @Author sjm
	 * @Date 10:21 2020/2/22 0022
	 * @param roleIds
	 * @param menuIds
	 * @param dataScopeIds
	 * @param apiScopeIds
	 * @return boolean
	 **/
	boolean grant(@NotEmpty List<Long> roleIds, Map<String,List<Long>> menuIds, Map<String,List<Long>> dataScopeIds, Map<String,List<Long>> apiScopeIds);

	/**
	 * @Description 获取角色名
	 * @Author sjm
	 * @Date 10:22 2020/2/22 0022
	 * @param roleIds
	 * @return java.util.List<java.lang.String>
	 **/
	List<String> getRoleNames(String roleIds);

	/**
	 * @Description 获取角色名
	 * @Author sjm
	 * @Date 10:22 2020/2/22 0022
	 * @param roleIds
	 * @return java.util.List<java.lang.String>
	 **/
	List<String> getRoleAliases(String roleIds);

	/**
	 * @Description 提交
	 * @Author sjm
	 * @Date 10:22 2020/2/22 0022
	 * @param role
	 * @return boolean
	 **/
	boolean submit(Role role);

	/**
	 * @Description 删除
	 * @Author sjm
	 * @Date 10:22 2020/2/22 0022
	 * @param roleId
	 * @return boolean
	 **/
	boolean removeByRoleId(Long roleId);

	/**
	 * @Description 根据roleIds查询roleName和Id
	 * @Author sjm
	 * @Date 10:22 2020/2/22 0022
	 * @param roleIds
	 * @return java.util.List<com.dhcc.bpm.modules.system.entity.Role>
	 **/
	List<Role> getRoleSelectByIds(String roleIds);

	/**
	 * @Description 根据角色id查询子节点
	 * @Author xiafayu
	 * @Date 2020/8/18 9:28
	 * @param parentId
	 * @return
	 * @throws
	 **/
	List<Role> getByParentId(String parentId);
}
